const Router = require('@koa/router');
const fun = require('../controller/system/dept.controller');
const config = require('../config');

const router = new Router({ prefix: `${config.ADMIN_PREFIX}` });

const str1 = '/sys-dept';

// 创建部门
router.post(str1, fun.createDept);

// 获取部门树状列表
router.get(str1, fun.listDepts);

// 更新部门
router.put(str1, fun.updateDept);

// 删除部门
router.delete(str1, fun.deleteDept);

//获取上级菜单树
router.get(str1 + '/tree', fun.getDeptTreeForSelect);

// 获取负责人穿梭框-全部用户
router.get(str1 + '/leader', fun.getDeptLeader);

// 获取单个部门信息
router.get(str1 + '/:id', fun.getDeptById);

module.exports = router;
